// const object1 = { name: "张三" };
// object1.name = "李四";
// console.log(object1)

let object1 = {};
let initValue = "";
Object.defineProperty(object1, "name", {
  // value: "张三",
  // writable: true, //可写
  enumerable: true, //可读
  configurable: false, //可以删除
  get() {
    // return "李四";
    return "I am " + initValue;
  },
  set(val) {
    // console.log(val,"111")
    // object1.name=val
    initValue = val;
  },
});

// // console.log(object1.name)
object1.name = "王五";
console.log(object1.name)

// let object1 = {};
// object1.name = "王五";
// console.log(object1.name);
